/****************************************************
          File Name:test.h
          Author: Abby Cin
          Mail: abbytsing@gmail.com
          Created Time: Thu 25 Dec 2014 09:17:25 PM CST
*****************************************************/

#ifndef TEST_H_
#define TEST_H_
#include<iostream>
using std::ostream;
class String
{
    private:
        char *str;
    public:
        String(const char *s);
        String();
        String(const String & s) ;
        ~String();

        friend ostream & operator<<(ostream & os, const String & s);
        // why can NOT using 'reference'????
        String & operator=(const String & s);               // must overload '='
        //String  operator+(const char *s);					// exist or not, make no defferaence !!!
        String  operator+(const String & s);               // b = a + c; or b = a.operator+(c);
        friend String  operator+(const char *s1, const String & s2);    // b = "abby" + a;
        // if no line 25, then:
        // for b = a + " criss"
        // b = a.operator+(String(" criss"))
        // first, the compiler creat a new tmp object Strring(" criss");
        // second, overload operator+ by using 'operator+(const String & s)'
};

#endif
